<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Emailmodel extends CI_Model {

	protected $_CI;

	public static $searchField = array();
	public static $likeField = array();

	public function __construct(){
		parent::__construct();
		$this->_CI = & get_instance();
	}

	public function sendEmail($to_emails,$subject,$message) {
		if(ENVIRONMENT!='production') $subject = '【测试系统邮件】'.$subject;
		$this->load->library('email');
		$this->email->from($this->email->smtp_user, $subject);
		$this->email->bcc(array_filter($to_emails)); 
		$this->email->subject($subject);
		$this->email->message($message); 
		$this->email->send();
	}
}